package org.autoparser;

import java.io.File;

import org.dom4j.DocumentException;

public class ZParserFactory {
	public static ZParser CreateZParser(final String xmlPath,final boolean useFastMode){
		File xmlf = new File(xmlPath);
		return CreateZParser(xmlf,useFastMode);
	}
	public static ZParser CreateZParser(File xmlf,boolean useFastMode){
		if(!xmlf.exists() || !xmlf.isFile())
			return null;
		try {
			return new ZParser(xmlf,useFastMode);
		} catch (DocumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	public static ZParser CreateZParser(final String xmlPath){
		return CreateZParser(xmlPath,true);
	}
	public static ZParser CreateZParser(File xmlf){
		return CreateZParser(xmlf,true);
	}
}
